package com.bestcem.xm.txtanls.dao.mapper;

import com.bestcem.xm.txtanls.entity.mysql.JoinInfoViewpointEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 示例服务
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/9/27
 */
@Mapper
public interface JoinInfoViewpointMapper {

    /**
     * 创建表
     *
     * @param tableName 表名称
     * @author jy.zhao
     * @date 2022/02/24 18:32
     **/
    int createNewTable(@Param("tableName")String tableName);
    /**
     * 根据 项目id 与 记录id列表获取数据
     *
     * @param projectId
     * @param recordIds
     * @return
     */
    List<JoinInfoViewpointEntity> listJoinInfos(@Param("projectId") String projectId,
                                                @Param("list") List<String> recordIds);

    /**
     * 根据项目id删除
     *
     * @param projectId
     */
    int deleteByProjectId(@Param("projectId") String projectId);

//    /**
//     * 根据 记录id列表获取数据
//     *
//     * @param recordId
//     * @return
//     */
//    List<JoinInfoViewpointEntity> listByRecordId(@Param("recordId") String recordId);

    /**
     * 批量创建
     *
     * @param joinInfoViewpointEntities
     * @return
     */
    void batchCreate(@Param("list") List<JoinInfoViewpointEntity> joinInfoViewpointEntities);


    List<JoinInfoViewpointEntity> listByProjectId(String projectId);

    /**
     * 根据viewpoint id 查询出record id
     *
     * @param projectId
     * @param viewpointIds
     * @return
     */
    List<JoinInfoViewpointEntity> listRecordIdByIds(@Param("projectId") String projectId, @Param("viewpointIds") List<String> viewpointIds);

    /**
     * 根据viewpoint id 和 score情感得分 查询出record id
     *
     * @param projectId
     * @param viewpointIds
     * @param viewpointScore
     * @return
     */
    List<JoinInfoViewpointEntity> listRecordIdByIdsAndScore(@Param("projectId") String projectId, @Param("viewpointIds") List<String> viewpointIds, @Param("viewpointScore") Integer viewpointScore);

    /**
     * 查询混合情感的所有原话id
     *
     * @param projectId
     * @param viewpointIds
     * @return
     */
    List<JoinInfoViewpointEntity> listRecordIdByIdsMix(@Param("projectId") String projectId, @Param("viewpointIds") List<String> viewpointIds);
}
